package com.reone.xiaozu.app.activity

import android.databinding.DataBindingUtil
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import com.bumptech.glide.load.engine.DiskCacheStrategy
import com.reone.xiaozu.R
import com.reone.xiaozu.databinding.ActivityMainBinding
import com.reone.xiaozu.app.vm.TalkContent
import com.reone.xiaozu.core.util.GlideApp

class MainActivity : AppCompatActivity() {
    private lateinit var binding: ActivityMainBinding
    private val talkContent = TalkContent()

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = DataBindingUtil.setContentView(this, R.layout.activity_main)
        binding.vm = talkContent
        showCenterImage()
    }

    private fun showCenterImage() {
        GlideApp.with(this).load(R.drawable.pri_gif).diskCacheStrategy(DiskCacheStrategy.ALL).into(binding.centerImage)
        talkContent.robotTalk = "我给你讲冷笑话好不好~"
        talkContent.yourTalk = "并不想听！！！"
    }
}
